import request from '@/utils/request'

import Qs from 'qs'
// POST 新增小区接口
export function addCommunity(params) {
  return request({
    url: '/community/add',
    method: 'post',
    data: params,
  })
}

//POST 删除小区接口
export function deleteCommunity(params) {
  return request({
    url: '/community/delete',
    method: 'post',
    data: params,
  })
}

//  GET 查询全部小区 GET   CommunityGET
export function findAllCommunity(params) {
  return request({
    url: '/community/findAll',
    method: 'get',
    params: params,
  })
}
//  GET 查询用户权限小区
export function findUserCommunity(params) {
  return request({
    url: '/community/findAllCommunity',
    method: 'get',
    params: params,
  })
}

//GET 查询小区列表GET  GET
export function findListCommunity(params) {
  return request({
    url: '/community/findList',
    method: 'get',
    params: params,
  })
}

//POST /community/updateCommunity修改小区接口  POST POST
export function updateCommunity(params) {
  return request({
    url: '/community/update',
    method: 'post',
    data: params,
  })
}

//同步社区
export function synCommunity(params) {
  return request({
    url: '/community/synCommunity',
    method: 'post',
    data: params,
  })
}

//查询所有没绑定小区的设备接口
export function getAllEquipment(params) {
  return request({
    url: '/equipment/getAllEquipment',
    method: 'get',
    params: params,
  })
}

//根据小区ID查询小区详情接口
export function findById(params) {
  return request({
    url: '/community/findById',
    method: 'get',
    params: params,
  })
}

//新增大门
export function addGate(params) {
  return request({
    url: '/community/addGate',
    method: 'post',
    data: params,
  })
}

//获取大门列表
export function findGateList(params) {
  return request({
    url: '/community/findGateList',
    method: 'get',
    params: params,
  })
}

//删除大门
export function deleteGate(params) {
  return request({
    url: '/community/deleteGate',
    method: 'post',
    data: params,
  })
}

//查询省市区小区
export function findCommunityId(params) {
  return request({
    url: '/community/findCommunityId',
    method: 'get',
    params: params,
  })
}

// 小区新增设备
export function bindCommunity(params) {
  return request({
    url: '/equipment/bindCommunity',
    method: 'post',
    data: params,
  })
}
// 解绑设备
export function unbindCommunity(params) {
  return request({
    url: '/equipment/unbindCommunity',
    method: 'post',
    data: params,
  })
}
// 查询街道
export function findStreet(params) {
  return request({
    url: '/community/findStreet',
    method: 'get',
    params: params,
  })
}

export function findAddress(params) {
  return request({
    url: '/community/findAddress',
    method: 'get',
    params: params,
  })
}

